package org.test.client.ui.content.uifeature;

import java.awt.Dimension;
import java.awt.Font;

import javax.swing.JButton;
import javax.swing.JPanel;

import org.test.client.ui.component.field.HighLightTextField;
import org.test.client.ui.component.field.TxtFieldSE;
import org.test.client.ui.util.VFlowLayout;

public class TxtFieldPanel extends JPanel{
	
	
	public TxtFieldPanel(){
		this.setLayout(new VFlowLayout(5));
		addElement();
		addElement2();
	}
	
	public void addElement(){
		HighLightTextField txtf = new HighLightTextField(TxtFieldSE.createStartIcon("fa-glass"),TxtFieldSE.createEndInfo("@qq.com"));
		txtf.setFont(new Font(Font.DIALOG, Font.PLAIN, 18));

		HighLightTextField txt1 = new HighLightTextField(TxtFieldSE.createStartIcon("fa-glass"),null);
		HighLightTextField txt2 = new HighLightTextField(null,TxtFieldSE.createEndIcon("fa-music"));
		txt2.borderColor = HighLightTextField.greenColor;
		txt2.highColor = HighLightTextField.greenColor;
		txt2.iconColor = HighLightTextField.greenColor;
		HighLightTextField txt3 = new HighLightTextField(TxtFieldSE.createStartIcon("fa-glass"),TxtFieldSE.createEndIcon("fa-music"));
		txt3.borderColor = HighLightTextField.orangeColor;
		txt3.highColor = HighLightTextField.orangeColor;
		txt3.iconColor = HighLightTextField.orangeColor;
		HighLightTextField txt4 = new HighLightTextField(null,TxtFieldSE.createEndInfo("@qq.com"));
		txt4.borderColor = HighLightTextField.redColor;
		txt4.highColor = HighLightTextField.redColor;
		txt4.iconColor = HighLightTextField.redColor;
		txt4.placeHolder = "Place holder";
		
		txtf.setPreferredSize(new Dimension(0,46));
		txt1.setPreferredSize(new Dimension(0,46));
		txt2.setPreferredSize(new Dimension(0,46));
		txt3.setPreferredSize(new Dimension(0,46));
		txt4.setPreferredSize(new Dimension(0,46));
		
		txtf.setEnabled(false);
		txt1.setEditable(false);
		this.add(txtf);
		this.add(txt1);
		this.add(txt2);
		this.add(txt3);
		this.add(txt4);
	}
	
	public void addElement2(){
		HighLightTextField txtf = new HighLightTextField(TxtFieldSE.createStartIcon("fa-glass"),TxtFieldSE.createEndInfo("@qq.com"));
		txtf.setFont(new Font(Font.DIALOG, Font.PLAIN, 18));

		HighLightTextField txt1 = new HighLightTextField(TxtFieldSE.createStartIcon("fa-glass"),null);
		HighLightTextField txt2 = new HighLightTextField(null,TxtFieldSE.createEndIcon("fa-music"));
		txt2.borderColor = HighLightTextField.greenColor;
		txt2.highColor = HighLightTextField.greenColor;
		txt2.iconColor = HighLightTextField.greenColor;
		HighLightTextField txt3 = new HighLightTextField(TxtFieldSE.createStartIcon("fa-glass"),TxtFieldSE.createEndIcon("fa-music"));
		txt3.borderColor = HighLightTextField.orangeColor;
		txt3.highColor = HighLightTextField.orangeColor;
		txt3.iconColor = HighLightTextField.orangeColor;
		HighLightTextField txt4 = new HighLightTextField(null,TxtFieldSE.createEndInfo("@qq.com"));
		txt4.borderColor = HighLightTextField.redColor;
		txt4.highColor = HighLightTextField.redColor;
		txt4.iconColor = HighLightTextField.redColor;
		txt4.placeHolder = "Place holder";
		
		txtf.setPreferredSize(new Dimension(0,46));
		txt1.setPreferredSize(new Dimension(0,46));
		txt2.setPreferredSize(new Dimension(0,46));
		txt3.setPreferredSize(new Dimension(0,46));
		txt4.setPreferredSize(new Dimension(0,46));
		
		txtf.needRound = false;
		txt1.needRound = false;
		txt2.needRound = false;
		txt3.needRound = false;
		txt4.needRound = false;
		
		this.add(txtf);
		this.add(txt1);
		this.add(txt2);
		this.add(txt3);
		this.add(txt4);
		
		
		HighLightTextField red = HighLightTextField.createRedField();
		red.setPreferredSize(new Dimension(0,46));
		TxtFieldSE end = TxtFieldSE.createEndIconWithinBorder("fa-times");
		red.end = end;
		this.add(red);
	}
}
